package com.example.administrator.myapplication.fragments;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;


import com.example.administrator.myapplication.MyAccountActivity;
import com.example.administrator.myapplication.MyRecordActivity;
import com.example.administrator.myapplication.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class MyFragment extends Fragment {

    Button mBtnAccount;
    Button mBtnRecord;





    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_my, container, false);
        mBtnAccount = view.findViewById(R.id.account);
        mBtnRecord = view.findViewById(R.id.record);
        return view;


    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mBtnAccount.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), MyAccountActivity.class);
                startActivity(intent);
            }
        });
        mBtnRecord.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), MyRecordActivity.class);
                startActivity(intent);
            }
        });

    }

}
